import React from 'react'
import { getMenuSub } from 'services/utils'
import { Icon } from 'antd'
import Notice from './pages/notice'
import SendMail from './pages/send-mail'
import UserExchange from './pages/user-exchange'
import UpdateConfig from './pages/update-config'
import RoleAdvice from './pages/role-advice'
import Flag from 'config/flag'

const routes = {
  path: '/proto-tool',
  name: '运营工具类',
  childRoutes: [
    //{ path: 'default', name: 'Home', component: Screen, isIndex: true },
    { 
      path: 'notice', 
      name: '系统公告', 
      component: Notice, 
      flags: Flag['/proto-tool/notice']
    },
    { 
      path: 'send-mail', 
      name: '系统邮件', 
      component: SendMail, 
      flags: Flag['/proto-tool/send-mail']
    },
    { 
      path: 'user-exchange', 
      name: '兑换信息查询', 
      component: UserExchange, 
      flags: Flag['/proto-tool/user-exchange']
    },
    { 
      path: 'update-config', 
      name: '更新配置表', 
      component: UpdateConfig, 
      flags: Flag['/proto-tool/update-config']
    },
    { 
      path: 'role-advice', 
      name: '用户建议汇总', 
      component: RoleAdvice, 
      flags: Flag['/proto-tool/role-advice']
    },
  ]
}

export default routes

export const menuSub = getMenuSub(routes, {
    key:   `proto-tool`, 
    //name:  `帐号管理`, 
    icon:  <Icon type="tool" />
  })